<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php if(JPluginHelper::isEnabled('authentication', 'openid')) :
		$lang = &JFactory::getLanguage();
		$lang->load( 'plg_authentication_openid', JPATH_ADMINISTRATOR );
		$langScript = 	'var JLanguage = {};'.
						' JLanguage.WHAT_IS_OPENID = \''.JText::_( 'WHAT_IS_OPENID' ).'\';'.
						' JLanguage.LOGIN_WITH_OPENID = \''.JText::_( 'LOGIN_WITH_OPENID' ).'\';'.
						' JLanguage.NORMAL_LOGIN = \''.JText::_( 'NORMAL_LOGIN' ).'\';'.
						' var comlogin = 1;';
		$document = &JFactory::getDocument();
		$document->addScriptDeclaration( $langScript );
		JHTML::_('script', 'openid.js');
endif; ?>

<script type="text/javascript">
	$(document).ready(function(){
	
    login=function(){
      if(($('#username').attr("value") == "" )){
            $('#alert').html('Udfyld venligst Brugernavn');
            $('#backoverlay').show();
            $('#show_popup').show();
            $('#f_focus').html('username');
            return false;	
        }       
		
		if(($('#passwd').attr("value") == "" )){
            $('#alert').html('Udfyld venligst Adgangskode:');
            $('#backoverlay').show();
            $('#show_popup').show();
            $('#f_focus').html('passwd');
            return false;	
        }  
     
        $('#Submit').click();
        
        return true;
	};    
 
    close_popup=function(){		
		var fel=$('#f_focus').html();
        $('#backoverlay').hide();
		$('#show_popup').hide();
		$('#' + fel ).focus();
	};
    
    });

</script> 
<style media="screen" type="text/css">
	#loginPopup { width: 330px; margin-left: 55px; }
	#loginPopup h1 { font-size: 22px; color: #1770b4; background:url(templates/bookrengoring/img/dotted_sep_line.gif) repeat-x bottom; padding-bottom: 8px; width: 310px;}
	#loginPopup input { margin-top: 5px; width: 300px;}
	#loginPopup label.check-box {line-height: 25px; font-size: 13px; float: left !important; margin-top: 4px; padding-bottom: 0;}
	#loginPopup label.check-box input {width: 14px;}
	#loginPopup p { clear: both; margin: 0; overflow: hidden;}
	#loginPopup p a {display: block; float: left; clear: left; color: #1770b4;}
	#loginPopup a.login-btn { background:url(templates/bookrengoring/img/login_btn.png) no-repeat; width: 117px; height: 35px; display: block; margin: 12px auto 0 auto; clear: both; text-indent: -9999px;}
	#loginPopup a.login-btn:hover { background-position: 0 -35px;}
</style>

<div id="loginPopup">
    <h1>Kunde login</h1>
    <div class="login-ctn">
<form action="<?php echo JRoute::_( 'index.php', true, $this->params->get('usesecure')); ?>" method="post" name="com-login" id="com-form-login">
<fieldset>
		<label for="username">Brugernavn:</label>
		<input name="username" id="username" type="text" class="inputbox" alt="username" size="18" />	
		<label for="passwd">Adgangskode:</label>
		<input type="password" id="passwd" name="passwd" class="inputbox" size="18" alt="password" />
	
	<?php if(JPluginHelper::isEnabled('system', 'remember')) : ?>
	<p id="com-form-login-remember">
		<label class="check-box" for="remember"><input type="checkbox" id="remember" name="remember" class="inputbox" value="yes" alt="Remember Me" />
		Husk mit login</label>	
	</p>
	<?php endif; ?>
	 <p>
	<a style="text-decoration:none" href="index.php?option=com_user&view=reset">• Glemt adgangskoden?</a>
			<?php 
	$usersConfig = &JComponentHelper::getParams( 'com_users' );
	if ($usersConfig->get('allowUserRegistration')) : ?>

	<a style="text-decoration:none" href="index.php?option=com_user&view=register">• Opret dig som bruger</a>
	<?php endif; ?>
                </p>
				  <a class="login-btn" onclick="login();" href="javascript:void(0);">Login</a>
	<input type="submit" id="Submit" name="Submit" class="button" value="<?php echo JText::_('LOGIN') ?>" style="display:none" />

 </fieldset>
	<input type="hidden" name="option" value="com_user" />
	<input type="hidden" name="task" value="login" />
	<input type="hidden" name="return" value="<?php echo $this->return; ?>" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
	</div>
</div>
